#include "equipment.h"
#include <string.h>

#define NO_WEAR	"NOT_WEAR"

Equipment::Equipment()
{
	memset(name,0,sizeof(name));
	memcpy(name,NO_WEAR,strlen(NO_WEAR));
	where = Equipment::NONE;
	health = HealthVals();
	fight = FightVals();
	defence = DefenceVals();
}

Equipment::Equipment(
		  char* n,WHERE_WEAR w,
		  unsigned int hp,unsigned int mp,
		  unsigned int attack,unsigned int magic,
		  unsigned int attackdef,unsigned int magicdef)
{
	memset(name,0,sizeof(name));
	memcpy(name,n,strlen(n));
	where = w;
	health = HealthVals(hp,mp);
	fight = FightVals(attack,magic);
	defence = DefenceVals(attackdef,magicdef);
	
}

Equipment& Equipment::operator=(const Equipment& e)
{
	memset(name,0,sizeof(name));
	memcpy(name,e.name,strlen(e.name));
	where = e.where;
	fight = e.fight;
	defence = e.defence;
	health = e.health;

	return *this;
}